<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport"
        content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no">
  <title>仿饿了么</title>
  <!-- ============以下是新增的============= -->
  <!-- cnd 加载css start-->
  <% if(htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.css){
    htmlWebpackPlugin.options.cdn.css.forEach(function(item){
  %>
  <link href="<%= item %>" rel="stylesheet" />
  <% })} %>
  <!-- cnd 加载css end-->
  <!-- ============以上是新增的============= -->
  <script src="https://as.alipayobjects.com/g/component/fastclick/1.0.6/fastclick.js"></script>
  <script>
    if ('addEventListener' in document) {
      document.addEventListener('DOMContentLoaded', function() {
        FastClick.attach(document.body);
      }, false);
    }
    // 假设移动端屏幕375px, 则1rem=100px .16rem=16px
    // 假设移动端屏幕414px, 则1rem=110.4px .16rem=17.664px
    function setFS(){
      let htmlWidth = document.documentElement.clientWidth || document.body.clientWidth;
      var fontSize = htmlWidth / 3.75 ;
      if(fontSize>200){
        fontSize = 200
      }
      document.getElementsByTagName('html')[0].style.fontSize = fontSize +'px';
    }
    setFS()
    window.onresize = setFS
   
  </script>
</head>
<body>
<div id="app"></div>

  <!-- ============以下是新增的============= -->
  <!-- cnd 加载js start-->
  <% if(htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.js)
  {
    htmlWebpackPlugin.options.cdn.js.forEach(function(item){
  %>
    <script type="text/javascript" src="<%= item %>"></script>
  <% })} %>
  <!-- cnd 加载js end-->
  <!-- ============以上是新增的============= -->
<!-- built files will be auto injected -->
</body>
</html>
